<template>
  <div>
    <el-select v-model="form.unitId" placeholder="请选择">
      <el-option
        v-for="item in options"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      >
      </el-option>
    </el-select>
    <el-button @click="getVal"> 点击 </el-button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      options: [
        {
          value: "0",
          label: "单位0",
        },
        {
          value: "1",
          label: "单位1",
        },
        {
          value: "2",
          label: "单位2",
        },
        {
          value: "3",
          label: "单位3",
        },
        {
          value: "4",
          label: "单位4",
        },
      ],
      form: {
        unitId: "0",
      },
    };
  },
  mounted() {
    console.log("this.form1", this.form.unitId);
  },
  methods: {
    getVal() {
      console.log("this.form2", this.form.unitId);
    },
  },
};
</script>
